home *** CD-ROM | disk | FTP | other *** search
/ Windows News 2010 Summer - Disc 1 / WN_Ete2010_CD1.iso / Onglet5 / Weezo / Weezo setup.exe / {code_appDir} / www / includes / uploadFlashWindow.php < prev    next >
PHP Script  |  2010-05-19  |  19KB  |  495 lines

  1. <?php
  2. /**
  3.  * Flash file upload script, executed in a popup window
  4.  
  5.  *
  6.  * PHP version 5
  7.  *
  8.  * LICENSE: This source file is subject to version 3.0 of the PHP license
  9.  * that is available through the world-wide-web at the following URI:
  10.  * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
  11.  * the PHP License and are unable to obtain it through the web, please
  12.  * send a note to license@php.net so we can mail you a copy immediately.
  13.  *
  14.  * @category   NA
  15.  * @package    NA
  16.  * @author     Nicolas Bruley / Peer 2 World <contact@weezo.net>
  17.  * @copyright  2005-2008 Nicolas Bruley / Peer 2 World
  18.  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
  19.  * @version    CVS: $Id:$
  20.  * @link       http://www.weezo.net
  21.  * @since      File available since Release 1.2.0
  22.  */
  23.  
  24. /**
  25.  * @desc Insert control needed for toggleing close transfer on upload completed
  26.  *
  27.  */
  28. function insertCloseOnCompletedControlFlash(){
  29.     $output='<form id="cocForm" name="cocForm" action="'.$_SERVER['PHP_SELF'].'">';
  30.     $output.='<input id="transferCloseOnCompleted" type="checkbox" '.((cfRGetVar('transferCloseOnCompleted'))?'checked="checked"':'').' onclick="dgn(\'toggleTransferCloseOnCompleted\').value=this.checked;asyncSubmitForm(\'cocForm\',true)"><input name="toggleTransferCloseOnCompleted" type="text" style="display:none"/>  ';
  31.     $output.=cfCaption('transferCloseOnFinish');
  32.     $output.='</form>';
  33.     return $output;
  34. }
  35.  
  36. define('FLASH_PLAYER_WIDTH',250);
  37. define('FLASH_PLAYER_HEIGHT',23);
  38.  
  39. require_once(INCLUDE_DIR.'outputFunctions.php');
  40. require_once(INCLUDE_DIR.'transferFunctions.php');
  41. require_once(INCLUDE_DIR.'explorerFunctions.php');
  42.  
  43.  
  44. /*
  45.  ***************************************************************************************************************************
  46.  * UPLOAD received
  47.  ***************************************************************************************************************************
  48.  */
  49. if(isset($_FILES['Filedata'])) {
  50.     $_FILES['ulInput']=$_FILES['Filedata'];
  51.     require(INCLUDE_DIR.'uploadWindow.php');
  52. }
  53.  
  54. /*
  55.  ***************************************************************************************************************************
  56.  * Asynchronous requests
  57.  ***************************************************************************************************************************
  58.  */
  59. if(isset($_POST['asyncRequest'])){
  60.     cfAsyncHeader();
  61.     //Close-on-upload completed toggle
  62.     if(isset($_POST['toggleTransferCloseOnCompleted'])) {
  63.         cfRSetVar('transferCloseOnCompleted',(($_POST['toggleTransferCloseOnCompleted']=='true')?true:false));
  64.     }
  65.  
  66.     // Create a transfer for upload
  67.     if(isset($_POST['createUploadTransfer'])){
  68.         if(isset($_POST['overwriteConfirmChecked'])) cfRSetVar('overwriteConfirmChecked',$_POST['overwriteConfirmChecked']);
  69.         //cfDbg($_POST,1);
  70.         $completeFilename=cfJoinPathFile(cfUTF8Decode($_POST['preUlDir']),cfUTF8Decode(basename($_POST['preUlFile'])));
  71.         $completeFilename=str_replace('*resourceBasePath*',cfRGetVar('path'),$completeFilename);
  72.  
  73.         // Forbid if destination file exists and cannot be overwritten
  74.         if(file_exists($completeFilename) && (!cfFileRights($completeFilename,'modify') || !is_writable($completeFilename))){
  75.             echo cfAsyncXMLJSaction('startSingleUploadProceed("","forbidden")');
  76.         }
  77.         // Ask for confirmation if destination file exists
  78.         elseif($_POST['overwrite']=='ask' && file_exists($completeFilename)){
  79.             echo cfAsyncXMLJSaction('startSingleUploadProceed("","confirm")');
  80.         }
  81.         // Skip if destination file exists
  82.         elseif($_POST['overwrite']=='skip' && file_exists($completeFilename)){
  83.             echo cfAsyncXMLJSaction('startSingleUploadProceed("","skip")');
  84.         }
  85.         // Create upload transfer
  86.         elseif(cfRGetVar('trackTransfers')){
  87.             if(!$tr=tAddUpload(cfUTF8Decode($_POST['preUlDir']), cfUTF8Decode(basename($_POST['preUlFile']))))
  88.                 echo cfAsyncXMLJSaction('uploadError()');
  89.             else
  90.                 echo cfAsyncXMLJSaction('startSingleUploadProceed("'.$tr->id.'")');
  91.         }
  92.         else echo cfAsyncXMLJSaction('startSingleUploadProceed("foo")'); // Fake transfer id
  93.     }
  94.  
  95.     die(cfAsyncFooter());
  96. }
  97.  
  98.  
  99.  
  100. /*
  101.  ***************************************************************************************************************************
  102.  * Page display
  103.  ***************************************************************************************************************************
  104.  */
  105. cfInsertHEAD();
  106.  
  107. if(is_array(cfRGetVar('extensionFilter'))) {
  108.     $browseFilter='';
  109.     foreach (cfRGetVar('extensionFilter') as $v) $browseFilter.=';*.'.$v;
  110.     $browseFilter='{"'.cfCaption('genFiles').'":"'.substr($browseFilter,1).'"}';
  111. }
  112. elseif(is_array(cfRGetVar('fileTypeFilter'))) {
  113.     require_once(INCLUDE_DIR.'mime_type.php');
  114.  
  115.     $browseFilter='{';
  116.     foreach (cfRGetVar('fileTypeFilter') as $type) {
  117.         if($browseFilter!='{') $browseFilter.=', ';
  118.         switch ($type){
  119.             case 'image':
  120.                 $browseFilter.='"'.cfCaption('genImages').'":';break;
  121.             case 'audio':
  122.                 $browseFilter.='"'.cfCaption('explorerAudioBrowse').'":';break;
  123.             case 'video':
  124.                 $browseFilter.='"'.cfCaption('genVideos').'":';break;
  125.             default:
  126.                 $browseFilter.='"'.ucfirst($type).'":';
  127.         }
  128.         $l=strlen($type)+1;
  129.         $tmp='';
  130.         foreach ($_ENV['weezoMime'] as $ext=>$mime) if(substr($mime,0,$l)==$type.'/'){
  131.             $tmp.=';*.'.$ext;
  132.         }
  133.         $browseFilter.='"'.substr($tmp,1).'"';
  134.     }
  135.     $browseFilter.='}';
  136. }
  137. else $browseFilter='0';
  138.  
  139. ?>
  140. <script type="text/javascript">
  141. var nbFiles=0;
  142. var uploadsArray={}// Array of files to be uploaded
  143. var uploadId;// Id of currently uploaded file
  144. var initOK=0;
  145. var uploadsCompleted=0; // 1 if all uploads completed
  146. var uploadsInProgress=0; // 1 if uploading
  147. var browseFilter=<?php echo $browseFilter;?>; // Dialog browse file filters
  148. var showAddFilesBt=0; // 1 if html browse button is used instead of flash button
  149. var bytesTotalAll=0; // Total size
  150. var bytesAll=0; // Total uploaded size
  151. var overwrite='ask'; // ask, skip, overwrite
  152. var overwriteConfirmChecked=<?php echo ((cfRGetVar('overwriteConfirmChecked'))?'1':'0');?>; // Server-side default prompt storage
  153. var WAInterval;
  154. var httpsErrorCaption="<?php echo cfCaptionJS('sslFlashImport');?>";
  155.  
  156. // Debug flash player
  157. function dbg(txt){
  158.     //alert(txt)
  159. }
  160.  
  161. // Init page
  162. function init(){
  163.     if(initOK++) return;
  164.     initLayout();
  165.     updateTotals();
  166.     document.onresize=initLayout;
  167.     winMe.setTitle("<?php echo cfCaption('genFileUpload')?>")
  168. }
  169. // Called by flash app
  170. function initFlashUpload(){
  171.     dgi("loadingIcon").style.display="none";
  172.     wl.getFlashPlayer('flashUpload').height=<?php echo FLASH_PLAYER_HEIGHT;?>;
  173.     wl.getFlashPlayer('flashUpload').width=<?php echo FLASH_PLAYER_WIDTH;?>;
  174.  
  175.     WAInterval=window.setInterval('initFlashPlayer()',10);
  176. }
  177. // Delayed player config (WA)
  178. function initFlashPlayer(){
  179.     var fpw=wl.getFlashPlayer('flashUpload').setBrowseButtonLabel("<?php echo cfCaption('addFiles');?>");
  180.     if(fpw) wl.getFlashPlayer('flashUpload').width=fpw+3;
  181.  
  182.     if(browseFilter) wl.getFlashPlayer('flashUpload').setFilter(browseFilter);
  183.     window.clearInterval(WAInterval);
  184.     if(fpw && phpBrowser=='opera') WAInterval=window.setInterval('resizeFlashPlayer('+fpw+')',10); // Opera WA
  185.     // Try to open browse window
  186.     try{wl.getFlashPlayer('flashUpload').addFiles();} catch(err){}
  187. }
  188. // Opera WA
  189. function resizeFlashPlayer(fpw){wl.getFlashPlayer('flashUpload').width=fpw+3;window.clearInterval(WAInterval);}
  190.  
  191. // Resize layout
  192. function initLayout(){
  193.     setActualHeight(dgi('frame1'),winMe.getInnerHeight()-ra(getElementStyle(dgi('frame1'),'margin-top',false))-ra(getElementStyle(dgi('frame1'),'margin-bottom',false))-7)
  194.     setActualHeight(dgi('uploadsDiv'),actualOffsetBottom(dgi('frame1'))-actualOffsetTop(dgi('uploadsDiv'))-ra(getElementStyle(dgi('frame1'),'padding-bottom',false))-dgi('destination').offsetHeight-ra(getElementStyle(dgi('destination'),'margin-bottom',false))-ra(getElementStyle(dgi('destination'),'margin-top',false))-7);
  195. }
  196. function ra(v){if(v=='auto') return 3; else return v;}
  197. function keyPressed(e) {
  198.     if(!e) e=window.event;
  199.     if (e.keyCode) keycode=e.keyCode; else keycode=e.which;
  200.     if(keycode==27 && !uploadsInProgress) winMe.closeMe();
  201. }
  202. function progressSetError(id){
  203.     var iht=dgi('PB'+id).parentNode.innerHTML;
  204.     iht='<span'+iht.substr(4,iht.length-8)+'span>';
  205.     dgi('PB'+id).parentNode.innerHTML=iht;
  206. }
  207. function sizeFormat(size){
  208.     if (size<1024) return size+" B";
  209.     if (size<1024*1024) return Math.floor(size/1024)+" KB";
  210.     if (size<1024*1024*1024) return Math.floor(size/1024/1024)+" MB";
  211.     else return Math.floor(size/1024/1024/1024)+" GB";
  212. }
  213. function updateTotals(){
  214.     bytesAll=0;
  215.     for(var e in uploadsArray) bytesAll+=uploadsArray[e]['bytes'];
  216.     dgi('totals').innerHTML=sizeFormat(bytesAll)+' / '+sizeFormat(bytesTotalAll);
  217. }
  218. function addFiles(){
  219.     wl.getFlashPlayer('flashUpload').addFiles(browseFilter);
  220. }
  221. // Browse button clicked
  222. function browseClick(){
  223.     // Re-uploading files: clear list
  224.     if(uploadsCompleted){
  225.         nbFiles=0;
  226.         uploadsArray={}
  227.         dgi('uploadsDiv').innerHTML='<table style="width:100%;layout:fixed" id="uploadsTable"></table>';
  228.         uploadsCompleted=0;
  229.         bytesTotalAll=0;updateTotals();
  230.     }
  231. }
  232. // Add a file to upload list, called by flash player
  233. function addSingleFile(id,name,size){
  234.     // Over max upload file size ?
  235.     if(size><?php echo cfGGetVar('uploadMaxFilesize')*1024*1024;?>){
  236.         alert("<?php echo cfCaption('configUploadMax').cfCaption('genSeparator').cfGGetVar('uploadMaxFilesize').cfCaption('genSizeMb');?>");
  237.         return;
  238.     }
  239.  
  240.     // Already exist ?
  241.     for(var uaid in uploadsArray){
  242.         if(uploadsArray[uaid]['name']==name && uploadsArray[uaid]['size']==size) return;
  243.     }
  244.  
  245.     // Insert HTML stuff
  246.     var iht=dgi('uploadTemplate').innerHTML.replace(/NAME[?]/,name+'<br><span class="smallFont">('+sizeFormat(size)+')').replace(/ID[?]/g,id).replace(/</g,'<').replace(/>/g,'>').replace(/LABEL/,"<?php echo cfCaption('transfersWaitConfirm');?>");
  247.     var className='eTC ';
  248.     var nb=0;for(i in uploadsArray) nb++;
  249.     if(nb%2) className+='odd'; else className+='even';
  250.  
  251.     if(phpBrowser=='ie'){
  252.         iht=dgi('uploadsTable').innerHTML+'<tr class="'+className+'" id="UL'+id+'" eH="1">'+iht+'</tr>';
  253.         if(iht.substr(0,15)=='<TBODY></TBODY>') iht=iht.substr(15);
  254.         dgi('uploadsDiv').innerHTML='<table style="width:100%;layout:fixed" id="uploadsTable">'+iht+'</table>';
  255.     }
  256.     else{
  257.         subNode=document.createElement('tr');
  258.         subNode.setAttribute('class',className);subNode.setAttribute('className',className);
  259.         subNode.setAttribute('id','UL'+id);
  260.         subNode.setAttribute('eH','1');
  261.         dgi('uploadsTable').appendChild(subNode);
  262.         subNode.innerHTML=iht;
  263.     }
  264.     // Add to uploads array
  265.     uploadsArray[id]={'state':'pending','name':name,'size':size,'bytes':0}
  266.     bytesTotalAll+=size;
  267.     updateTotals();
  268.  
  269.     if(!nbFiles) wl.button.enable('startUploads')
  270.     nbFiles++;
  271. }
  272. // Remove a file from upload list
  273. function removeSingleFile(id){
  274.     if(!dgi('UL'+id) || !uploadsArray[id]) return;
  275.     // If upload started, cancel through flash, and wait for cancel event
  276.     if(uploadsArray[id]['state']=='started') {
  277.         wl.getFlashPlayer('flashUpload').cancelUpload(id);
  278.         return;
  279.     }
  280.     dgi('UL'+id).parentNode.removeChild(dgi('UL'+id));
  281.     bytesTotalAll-=uploadsArray[id]['size'];
  282.     updateTotals();
  283.     delete(uploadsArray[id]);
  284.     // Reset odd/even lines
  285.     var nb=0;for(i in uploadsArray) {
  286.         dgi('UL'+i).className="eTC "+((nb%2)?'odd':'even');
  287.         nb++;
  288.     }
  289.     nbFiles--;
  290.     if(!nbFiles) wl.button.disable('startUploads')
  291.     while(dgi('uploadsTable').firstChild.nodeType==3) dgi('uploadsTable').removeChild(dgi('uploadsTable').firstChild);
  292. }
  293. // Start uploading list
  294. function startUploads(){
  295.     //wl.button.disable('addFiles');
  296.     wl.button.disable('startUploads');
  297.     winMe.closeable(false);
  298.     winMe.reloadable (false);
  299.     wl.getFlashPlayer('flashUpload').width=1;
  300.     wl.getFlashPlayer('flashUpload').height=1;
  301.     wl.button.disable('addFilesBt');
  302.     uploadsInProgress=1;
  303.  
  304.     // Start 1st upload
  305.     for(id in uploadsArray){
  306.         startSingleUpload(id);
  307.         break;
  308.     }
  309.  
  310. }
  311.  
  312. // Start uploading a file
  313. function startSingleUpload(id,forceOverwrite){
  314.     uploadId=id;
  315.     progressSetPerc('PB'+uploadId,0);
  316.     progressSetText('PB'+uploadId,"<?php echo cfCaption('transfersConnecting')?>");
  317.  
  318.     // scroll view to new upload
  319.     var eT=dgi('TR'+id).offsetTop;
  320.     var sT=dgi('uploadsDiv').scrollTop;
  321.     if(eT<sT || eT+dgi('TR'+id).offsetHeight>sT+dgi('uploadsDiv').offsetHeight)    dgi('uploadsDiv').scrollTop=eT;
  322.  
  323.     // overwrite existing files
  324.     if(forceOverwrite) dgn('overwrite').value='overwrite'; else dgn('overwrite').value=overwrite;
  325.     dgn('overwriteConfirmChecked').value=overwriteConfirmChecked;
  326.  
  327.     dgn("preUlFile").value=uploadsArray[id]['name'];
  328.     asyncSubmitForm('newUploadTransfer');
  329. }
  330. function startSingleUploadProceed(transferId,action){
  331.     id=uploadId;
  332.     // Dest file protected
  333.     if(action=='forbidden'){
  334.         progressSetError(uploadId);
  335.         uploadsArray[id]['state']='error';
  336.         progressSetText('PB'+uploadId,"<?php echo cfCaption('explorerErrorFileSend2');?>");
  337.         uploadProcessNext();
  338.     }
  339.     // Dest file existing, skip
  340.     if(action=='skip'){
  341.         uploadsArray[id]['state']='skip';
  342.         progressSetText('PB'+uploadId,"<?php echo cfCaption('transfersCanceled');?>");
  343.         uploadProcessNext();
  344.     }
  345.     // Confirm overwrite
  346.     else if(action=='confirm'){
  347.         var m=new dialogBox({'text':"<?php echo cfCaption('genFileAlreadyExistReplace');?>",'title':uploadsArray[id]['name'],'icon':"<?php echo outIcon('alert');?>",'mask':1,'fade':1,'buttons':{'ok':"<?php echo cfCaption('genYes');?>",'cancel':"<?php echo cfCaption('genNo');?>"},'check':overwriteConfirmChecked,'checkText':"<?php echo cfCaption('dontAskAnymore')?>"},'uploadOverwrite');
  348.         m.show();
  349.     }
  350.     // cancel overwrite
  351.     else if(action=='confirm' && !overwriteAsk && !overwriteDefault){
  352.         uploadsArray[id]['state']='canceled';
  353.         progressSetText('PB'+uploadId,"<?php echo cfCaption('transfersCanceled');?>");
  354.         uploadProcessNext();
  355.     }
  356.     // proceed upload
  357.     else{
  358.         uploadsArray[id]['state']='started';
  359.         //alert("start upload of "+uploadsArray[id]['name'])
  360.         var res=wl.getFlashPlayer('flashUpload').startSingleUpload(id,transferId,"<?php echo $_SERVER['PHP_SELF'];?>","<?php echo wSession_id();?>","<?php echo cfUTF8Encode(cfResourceRelativePath(cfRGetVar('efCurrentDirectory')));?>");
  361.         if(res==undefined) window.setTimeout('startSingleUploadProceed("'+id+'")',20);
  362.     }
  363. }
  364. // Overwrite dialogBox result
  365. function uploadOverwrite(result){
  366.     overwriteConfirmChecked=(result['check'])?1:0;
  367.  
  368.     if(result['button']=='ok') {
  369.         if(overwriteConfirmChecked) overwrite='overwrite';
  370.         startSingleUpload(uploadId,1);
  371.     }
  372.     else{
  373.         if(overwriteConfirmChecked) overwrite='skip';
  374.         uploadsArray[uploadId]['state']='canceled';
  375.         progressSetText('PB'+uploadId,"<?php echo cfCaption('transfersCanceled');?>");
  376.         uploadProcessNext();
  377.     }
  378. }
  379.  
  380. // Update progress (called by flash)
  381. function uploadSetProgress(bytes,bytesTotal){
  382.     progressSetPerc('PB'+uploadId,Math.floor(100*bytes/bytesTotal));
  383.     if(bytes==bytesTotal) progressSetText('PB'+uploadId,sizeFormat(bytes)+'/'+sizeFormat(bytesTotal)+' (<img src="/gfx/loading.gif" style="height:1em;width:1em;vertical-align:middle">)');
  384.     else progressSetText('PB'+uploadId,sizeFormat(bytes)+'/'+sizeFormat(bytesTotal)+' ('+(Math.floor(100*bytes/bytesTotal))+' %)');
  385.     uploadsArray[uploadId]['bytes']=bytes;
  386.     updateTotals();
  387. }
  388. // Upload error (called by flash, or by async response of transfer id request)
  389. function uploadError(errTxt){
  390.     progressSetPerc('PB'+uploadId,0);
  391.     progressSetError(uploadId);
  392.     if(errTxt=='403') progressSetText('PB'+uploadId,"<?php echo cfCaption('explorerErrorFileSend2');?>");
  393.     else progressSetText('PB'+uploadId,"<?php echo cfCaption('transfersFailed')?> ("+errTxt+")");
  394.     uploadsArray[uploadId]['state']='error';
  395.     if(errTxt=='IO err' && location.protocol=='https:') alert(httpsErrorCaption);
  396.     else uploadProcessNext();
  397. }
  398. // Upload completed (called by flash)
  399. function uploadCompleted(){
  400.     if(uploadsArray[uploadId]['state']=='error') return;
  401.     progressSetPerc('PB'+uploadId,100);
  402.     progressSetText('PB'+uploadId,"<?php echo cfCaption('transfersFinished')?> ("+sizeFormat(uploadsArray[uploadId]['size'])+")");
  403.     uploadsArray[uploadId]['state']='completed';
  404.     uploadsArray[uploadId]['bytes']=uploadsArray[uploadId]['size'];
  405.     updateTotals();
  406.     uploadProcessNext();
  407. }
  408. // Upload canceled (called by flash)
  409. function uploadCanceled(){
  410.     progressSetError(uploadId);
  411.     progressSetText('PB'+uploadId,"<?php echo cfCaption('transfersCanceled')?>");
  412.     uploadErrorAnim(uploadId);
  413.     uploadsArray[uploadId]['state']='canceled';
  414.     uploadProcessNext();
  415. }
  416. function uploadErrorAnim(id){
  417.     var p=(progressGetPerc('PB'+id)*0.9); if(p<1)p=0;
  418.     progressSetPerc('PB'+id,p);
  419.     if(p) window.setTimeout('uploadErrorAnim("'+id+'")',10);
  420. }
  421. // Process next upload
  422. function uploadProcessNext(){
  423.     if(dgi('CANCELBT'+uploadId)) wl.button.disable('CANCELBT'+uploadId);
  424.     for(id in uploadsArray) if(uploadsArray[id]['state']=='pending'){
  425.         startSingleUpload(id);
  426.         return;
  427.     }
  428.  
  429.     // All uploads completed
  430.     uploadsCompleted=1;
  431.     uploadsInProgress=0;
  432.     winMe.closeable(true);
  433.     //dgi('flashPlayerSpan').innerHTML+=" ";
  434.  
  435.     // Close window if requested and if no error
  436.     if(dgi('transferCloseOnCompleted').checked) {
  437.         closeMe=1;
  438.         for(id in uploadsArray) if(uploadsArray[id]['state']=='error') closeMe=0;
  439.         if(closeMe) winMe.closeMe();
  440.     }
  441.     if(showAddFilesBt) wl.button.enable('addFilesBt');
  442.     else{
  443.         wl.getFlashPlayer('flashUpload').width=<?php echo FLASH_PLAYER_WIDTH;?>;
  444.         wl.getFlashPlayer('flashUpload').height=<?php echo FLASH_PLAYER_HEIGHT;?>;
  445.     }
  446. }
  447.  
  448. </script>
  449. </head>
  450. <body onresize="initLayout()">
  451.  
  452. <?php // Form used to ask for a transfer id ?>
  453. <form id="newUploadTransfer" style="display:none">
  454. <input name="createUploadTransfer" value="1">
  455. <input name="preUlDir" type="text" value="<?php echo cfUTF8Encode(cfResourceRelativePath(cfRGetVar('efCurrentDirectory')));?>">
  456. <input name="preUlFile" type="text" >
  457. <input name="overwrite" type="text" value="0">
  458. <input name="overwriteConfirmChecked" type="text">
  459. </form>
  460.  
  461. <div id="uploadTemplate" style="display:none">
  462. <?php echo str_replace('<','<','<td id="TRID?" class="eTCLeft" style="text-align:left;width:15em;overflow:hidden;text-overflow:ellipsis;-o-text-overflow:ellipsis;white-space:nowrap;">NAME?</td><td>'.outProgressBar(0,'100%','LABEL','PBID?').'</td><td class="eTCRight" style="text-align:center;width:5em">'.outButton(false,'javascript:removeSingleFile(\'ID?\')',outIcon('cancel'),cfCaption('transferRemove'),'CANCELBTID?','').'</td>');?>
  463. </div>
  464.  
  465. <?php
  466. echo outDivFrame('frame1','id="frame1"');
  467. echo outFrameHeaderTable('frame1Header',
  468.     // Loading icon
  469.     outImage(outIcon('loading'),false,'id="loadingIcon"','vertical-align:middle').
  470.     // HTML add files button
  471.     outButton(cfCaption('addFiles'),'javascript:addFiles()',outIcon('addMult'),false,'addFilesBt','style="display:none"').
  472.     // Flash player
  473.     '<span id="flashPlayerSpan">'.outFlashPlayer('/js/upload.swf','flashUpload',250,FLASH_PLAYER_HEIGHT).'</span>',
  474.     // Send button
  475.     outButtonDisabled(cfCaption('genSend'),'javascript:startUploads()',outIcon('upload'),false,'startUploads')
  476. );
  477. /**
  478.  * OVERFLOW FRAME
  479.  */
  480. echo outDivFrame('frame2','id="uploadsDiv"'.outEHoverFrameAttr(),'overflow:auto');
  481. ?>
  482. <table style="width:100%;layout:fixed" id="uploadsTable" cellpadding="0" cellspacing="0" border="0">
  483.  
  484.  
  485. <?php
  486. echo '</table>'; //table
  487. echo '</div>'; // uploadsDiv
  488. echo outFrameHeaderTable('','<div class="warning" style="white-space:nowrap;overflow:hidden">'.cfCaption('transferCfgDest').cfCaption('genSeparator').efDirLabel(cfRGetVar('efCurrentDirectory')).'</div>'.cfCaption('explorerTotalSize').cfCaption('genSeparator').'<span id="totals"></span>',insertCloseOnCompletedControlFlash(),'id="destination"');
  489. echo '</div>'; // frame1
  490. ?>
  491. <script type="text/javascript">
  492. document.onkeypress=keyPressed;
  493. init();
  494. </script>
  495. </body>